define(["jQuery"], function ($) {
    return {
		isMobileDevice : function(){
			return navigator.userAgent.match(/Android/i)
					|| navigator.userAgent.match(/webOS/i)
					|| navigator.userAgent.match(/iPhone/i)
					|| navigator.userAgent.match(/iPad/i)
					|| navigator.userAgent.match(/iPod/i)
					|| navigator.userAgent.match(/BlackBerry/i)
					|| navigator.userAgent.match(/Touch/i)
					|| navigator.userAgent.match(/Windows Phone/i);
		},
		setBasicDimension : function (object,x,y,width,height){
			object.css("left",parseInt(x));
			object.css("top",parseInt(y));
			object.css("height",parseInt(height));
			object.css("width",parseInt(width));
		},
		colorToHex:function (color) {
			if (color.substr(0, 1) === '#') {
				return color;
			}
			// var digits = /(.*?)rgb\((\d+), (\d+), (\d+)\)/.exec(color);
			
			color = color.substring(4,color.length-1);
			digits=color.split(',');
			
			var red = parseInt(digits[0]);
			var green = parseInt(digits[1]);
			var blue = parseInt(digits[2]);
			
			var rgb = blue | (green << 8) | (red << 16);
			return  rgb.toString(16);
		}
	}
});